package com.spboot.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.spboot.app.pojo.Baoming;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface BaomingMapper extends BaseMapper<Baoming> {
    @Select("SELECT b.*, a.xingming AS yonghu_name FROM baoming b LEFT JOIN yonghu a ON b.yonghu_id = a.id WHERE b.saishi_id = #{saishiId}")
    List<Map<String, Object>> getListBySaishiIdWithUser(Integer saishiId);

}
